﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.DotNet.Aspects.Impl
{
	public partial class AspectClassCreator
	{

		protected virtual void CreateOpenGenericMethodOverride(MethodInfo method, IEnumerable<AspectInfo> aspects)
		{
			CreateOpenGenericPrivateProceedMethod(method);
		}

		protected MethodBuilder CreateOpenGenericPrivateProceedMethod(MethodInfo method)
		{
			MethodAttributes methodAttributes = MethodAttributes.Private | MethodAttributes.HideBySig;
			MethodBuilder proxyMethod = typeBuilder.DefineMethod("Proxy_" + method.Name, methodAttributes);

			// Setting return type
			proxyMethod.SetReturnType(typeof(void));

			// Adding parameters
			proxyMethod.SetParameters(typeof(IAspectInvokeContext));

			return null;
		}
	}
}
